package com.cskaoyan.shopping.service.yjc;

import com.cskaoyan.shopping.converter.ProductCateConverter;
import com.cskaoyan.shopping.dal.entitys.ItemCat;
import com.cskaoyan.shopping.dal.persistence.ItemCatMapper;
import com.cskaoyan.shopping.dto.ProductCateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IProductCateServiceImpl_yjc implements IProductCateService_yjc {
    @Autowired
    ItemCatMapper itemCatMapper;

    @Autowired
    ProductCateConverter productCateConverter;

    @Override
    public List<ProductCateDto> getAllProductCate() {
        List<ItemCat> itemCats = itemCatMapper.selectAll();
        List<ProductCateDto> productCateDtos = productCateConverter.items2Dto(itemCats);
        return productCateDtos;
    }
}
